<!-- !Main -->
<div id="main" class="sidebar-right"><!-- class="sidebar-none", class="sidebar-left", class="sidebar-right" -->

    <div class="wf-wrap">
        <div class="wf-container-main">

            <div id="content" role="main" class="content">

                <article class="post">

                    <h1 class="entry-title">Danh sách đơn hàng</h1>
                    <div class="hr-breadcrumbs divider-heder">
                        <div class="assistive-text">You are here:</div>
                        <ol class="breadcrumbs wf-td text-small flat">
                            <li><a href="<?php echo $this->baseUrl?>">Home</a></li>
                            <li><a href="<?php echo $this->createUrl('/web/customer/bills')?>">Danh sách đơn hàng</a></li>
                        </ol>
                    </div>
                    <div class="wf-container">
                        <div class="wf-cell wf-2-2">

                            <?php $this->widget('web.components.widgets.AlertWidget');?>

                            <blockquote class="shortcode-blockquote block-style-widget">
                                <em>
                                    Xem và theo dõi đơn hàng của bạn.
                                </em>
                            </blockquote>
                        </div>
                    </div>

                    <?php
                        $this->widget('zii.widgets.grid.CGridView', array(
                            'id'=>'bill-grid',
                            'dataProvider'=>$dataProvider,
                            'filter'=>$model,
                            'template' => "{summary}\n{items}\n{pager}",
                            'summaryCssClass' => '',
                            'pagerCssClass' => '', 
                            'itemsCssClass' => 'table table-bordered table-striped table-hover',
                            'ajaxUpdate'=> TRUE,
                            'beforeAjaxUpdate'=>'function(id,options){
                                $("#ajax-loading").fadeIn();    
                            }',
                            'afterAjaxUpdate'=>'function(id,options){
                                $("#ajax-loading").fadeOut();    
                            }',
                            'loadingCssClass' => '',
                            'columns'=>array(
                                array(
                                    'name' => 'created',
                                    'value' => '$data->created',
                                    'filterHtmlOptions' => array('class' => 'datetimepicker'),
                                ),
                                array(
                                    'header' => 'Mã đơn hàng',
                                    'name' => 'code',
                                    'value' => '$data->code',
                                    'filterHtmlOptions' => array(),
                                ),
                                //                                array(
                                //                                    'name' => 'branch_id',
                                //                                    'value' => '$data->branch->name',
                                //                                    'type' => 'html',
                                //                                    'filter' => Branch::model()->branchData,
                                //                                    'filterHtmlOptions' => array('style' => 'width: 120px'),
                                //                                ),

                                array(
                                    'name' => 'status_pay',
                                    'value' => '$data->statusPayLabel',
                                    'type' => 'html',
                                    'filter' => $model->statusPayData,
                                    'filterHtmlOptions' => array(),
                                ),
                                array(
                                    'name' => 'status_do',
                                    'value' => '$data->statusDoLabel',
                                    'type' => 'html',
                                    'filter' => $model->statusDoData,
                                    'filterHtmlOptions' => array('style' => 'width: 100px'),
                                ),
                                array(
                                    'name' => 'status_return',
                                    'value' => '$data->statusReturnLabel',
                                    'type' => 'html',
                                    'filter' => $model->statusReturnData,
                                    'filterHtmlOptions' => array(),
                                ),
                                array(
                                    'name' => 'status',
                                    'value' => '$data->statusLabel',
                                    'type' => 'html',
                                    'filter' => $model->statusData,
                                    'filterHtmlOptions' => array(),
                                ),
                                array(
                                    'class'=>'CButtonColumn',
                                    'template'=>'{view}',
                                    'buttons' => array(
                                        'view' => array(
                                            'url'=>'$data->url',
                                            'label'=>'Xem đơn hàng',
                                        ),
                                    ),
                                ),
                            ),
                        )); ?> 

                    <div class="gap-10"></div>
                    <div class="hr-thin"></div>
                    <div class="gap-10"></div>



                </article><!-- .post -->


            </div><!-- #content -->


            <?php $this->renderPartial('//common/sidebar');?>

        </div><!-- .wf-container -->
    </div><!-- .wf-wrap -->
</div><!-- #main -->
<script>
    $(function(){
            $(".datetimepicker input").live('click focus', function(){
                $(this).datepicker({ dateFormat: 'yy-mm-dd' });
            });
    });   
</script>